public class MedicareEligibilityCalculator {

	/**
	 * if age is 65 or above, he/she is eligible irrespective of state and sex
	 * if he/she has pre-existing condition then he/she is eligible if age is
	 * greater than 45 and state is Texas, he/she is eligible
	 * 
	 * 
	 * @param age
	 * @param preExistingCondition
	 * @param state
	 * @return
	 */
	public boolean isEligible(int age, boolean haspreExistingCondition,
			String state) {
		if (age >= 65) {
			return true;
		} else if (haspreExistingCondition) {
			return true;
		} else if (age > 45 && state.equals("TX")) {
			return true;
		} else {
			return false;
		}
	}
}
